package com.kujie.access.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kujie.access.domain.po.AccessPolicySubmitInformation;
import com.kujie.access.domain.po.AccessTenantManagement;
import com.kujie.access.utils.ConvertUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * 政策提交 导入导出VO
 *
 * @author check
 * @date 2025-07-03
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PolicySubmitInformationExportImportVO implements Serializable {
    @Serial
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    /**
     * 企业名称
     */
    @ExcelProperty("企业名称")
    private String companyName;

    /**
     * 是否签订招商协议(0-否，1-是)
     */
    @ExcelProperty("是否签订招商协议")
    private String isSigned;

    /**
     * 招商协议签订日期
     */
    @ExcelProperty(value = "招商协议签订日期")
    @DateTimeFormat("yyyy/M/d")
    private LocalDate signDate;


    /**
     * 第一年补贴时间（是否已申请、进度）
     */
    @ExcelProperty("第一年补贴时间（是否已申请、进度）")
    private String firstYearSubsidyPeriod;

    /**
     * 第二一年补贴时间（是否已申请、进度）
     */
    @ExcelProperty("第二年补贴时间（是否已申请、进度）")
    private String secondYearSubsidyPeriod;

    /**
     * 第三一年补贴时间（是否已申请、进度）
     */
    @ExcelProperty("第三年补贴时间（是否已申请、进度）")
    private String thirdYearSubsidyPeriod;

    /**
     * 统一社会信用代码
     */
    @ExcelProperty("统一社会信用代码")
    private String unifiedSocialCreditIdentifier;

    /**
     * 高企编号
     */
    @ExcelProperty("高企编号")
    private String highLevelIdentificationNumber;

    /**
     * 是否规上
     */
    @ExcelProperty("是否规上")
    private String isStatistics;

    /**
     * 技术领域
     */
    @ExcelProperty("技术领域")
    private String technosphere;

    /**
     * 主营业务
     */
    @ExcelProperty("主营业务")
    private String mainBusiness;

    /**
     * 成立时间，例：2025-06-30
     */
    @ExcelProperty("成立时间")
    @DateTimeFormat("yyyy/M/d")
    private LocalDate establishedTime;

    /**
     * 区县
     */
    @ExcelProperty("区县")
    private String districtsAndCounties;

    /**
     * 园区
     */
    @ExcelProperty("园区")
    private String garden;

    /**
     * 所属街道
     */
    @ExcelProperty("所属街道")
    private String theAffiliatedStreet;

    /**
     * 知识产权数量
     */
    @ExcelProperty("知识产权数量")
    private String intellectualCount;

    /**
     * 是否为中小企业(0-否，1-是)
     */
    @ExcelProperty("是否为中小企业")
    private String isMediumOrSmall;

    /**
     * 参保人数
     */
    @ExcelProperty("参保人数")
    private String numberOfInsuredIndividuals;

    /**
     * 2024年营收
     */
    @ExcelProperty("2024年营收")
    private String revenueIn2024;

    /**
     * 2024年税收
     */
    @ExcelProperty("2024年税收")
    private String taxationIn2024;

    /**
     * 是否入驻孵化器(0-否，1-是)
     */
    @ExcelProperty("是否入驻孵化器")
    private String isJoinTheIncubator;

    /**
     * 需要链接企业类型
     */
    @ExcelProperty("需要链接企业类型")
    private String needToLinkTheEnterpriseType;

    /**
     * 企业法人
     */
    @ExcelProperty("企业法人")
    private String companyLegelPerson;

    /**
     * 法人性别(0-未知，1-男，2-女)
     */
    @ExcelProperty("法人性别")
    private String legalGender;

    /**
     * 法人年龄
     */
    @ExcelProperty("法人年龄")
    private String legalAge;

    /**
     * 法人学历
     */
    @ExcelProperty("法人学历")
    private String legalDegree;

    /**
     * 法人持股比例
     */
    @ExcelProperty("法人持股比例")
    private String shareholdingRatioOfLegalEntities;

    /**
     * 法人联系电话
     */
    @ExcelProperty("法人联系电话")
    private String legelPersonPhone;

    /**
     * 行政联系人（企业联系人）
     */
    @ExcelProperty("行政联系人（企业联系人）")
    private String administrativeContactPerson;

    /**
     * 行政联系电话（企业联系人电话）
     */
    @ExcelProperty("行政联系电话（企业联系人电话）")
    private String administrativeContactPersonPhone;

    /**
     * 企业注册地址
     */
    @ExcelProperty("企业注册地址")
    private String businessRegistrationAddress;

    /**
     * 实际办公地址
     */
    @ExcelProperty("实际办公地址")
    private String actualOfficeAddress;

    /**
     * 备注
     */
    @ExcelProperty("备注")
    private String remark;

    public PolicySubmitInformationExportImportVO(AccessPolicySubmitInformation accessPolicySubmitInformation, AccessTenantManagement accessTenantManagement) {
        if (accessPolicySubmitInformation != null) {
            this.isSigned = ConvertUtil.getCheckIf(accessPolicySubmitInformation.getIsSigned());
            this.signDate = accessPolicySubmitInformation.getSignDate();
            this.firstYearSubsidyPeriod = accessPolicySubmitInformation.getFirstYearSubsidyPeriod();
            this.secondYearSubsidyPeriod = accessPolicySubmitInformation.getSecondYearSubsidyPeriod();
            this.thirdYearSubsidyPeriod = accessPolicySubmitInformation.getThirdYearSubsidyPeriod();
            this.highLevelIdentificationNumber = accessPolicySubmitInformation.getHighLevelIdentificationNumber();
            this.isStatistics = ConvertUtil.getCheckIf(accessPolicySubmitInformation.getIsStatistics());
            this.technosphere = accessPolicySubmitInformation.getTechnosphere();
            this.districtsAndCounties = accessPolicySubmitInformation.getDistrictsAndCounties();
            this.garden = accessPolicySubmitInformation.getGarden();
            this.theAffiliatedStreet = accessPolicySubmitInformation.getTheAffiliatedStreet();
            this.intellectualCount = accessPolicySubmitInformation.getIntellectualCount();
            this.isMediumOrSmall = ConvertUtil.getCheckIf(accessPolicySubmitInformation.getIsMediumOrSmall());
            this.numberOfInsuredIndividuals = accessPolicySubmitInformation.getNumberOfInsuredIndividuals();
            this.revenueIn2024 = accessPolicySubmitInformation.getRevenueIn2024();
            this.taxationIn2024 = accessPolicySubmitInformation.getTaxationIn2024();
            this.isJoinTheIncubator = ConvertUtil.getCheckIf(accessPolicySubmitInformation.getIsJoinTheIncubator());
            this.needToLinkTheEnterpriseType = accessPolicySubmitInformation.getNeedToLinkTheEnterpriseType();
            this.legalGender = ConvertUtil.getGender(accessPolicySubmitInformation.getLegalGender());
            this.legalAge = accessPolicySubmitInformation.getLegalAge();
            this.legalDegree = accessPolicySubmitInformation.getLegalDegree();
            this.shareholdingRatioOfLegalEntities = accessPolicySubmitInformation.getShareholdingRatioOfLegalEntities();
            this.remark = accessPolicySubmitInformation.getRemark();
        }

        if (accessTenantManagement != null) {
            this.unifiedSocialCreditIdentifier = accessTenantManagement.getUnifiedSocialCreditIdentifier();
            this.mainBusiness = accessTenantManagement.getMainBusiness();
            this.establishedTime = accessTenantManagement.getEstablishedTime();
            this.companyName = accessTenantManagement.getCompanyName();
            this.companyLegelPerson = accessTenantManagement.getCompanyLegelPerson();
            this.administrativeContactPerson = accessTenantManagement.getAdministrativeContactPerson();
            this.administrativeContactPersonPhone = accessTenantManagement.getAdministrativeContactPersonPhone();
            this.businessRegistrationAddress = accessTenantManagement.getBusinessRegistrationAddress();
            this.actualOfficeAddress = accessTenantManagement.getActualOfficeAddress();
        }
    }
}
